// hash
package hash

import (
	"crypto/md5"
	"crypto/sha1"
	"encoding/hex"
)

// MD5 md5加密
func MD5(s string) string {
	hash := md5.New()
	hash.Write([]byte(s))
	return hex.EncodeToString(hash.Sum(nil))
}

// SHA1 sha1加密
func SHA1(s string) string {
	o := sha1.New()
	o.Write([]byte(s))
	return hex.EncodeToString(o.Sum(nil))
}
